<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <p id="intro">你好世界!</p>
    <!-- HTML结构 -->
    <div id="test-div">
        <div class="c-red">
            <p id="test-p">JavaScript</p>
            <p>Java</p>
        </div>
        <div class="c-red c-green">
            <p>Python</p>
            <p>Ruby</p>
            <p>Swift</p>
        </div>
        <div class="c-green">
            <p>Scheme</p>
            <p>Haskell</p>
        </div>
    </div>


    <div id="test-div2">
        <div class="c-red">
            <p id="test-p">JavaScript</p>
            <p>Java</p>
        </div>
        <div class="c-red c-green"></div>
        <div></div>
    </div>

</body>
<script>
    x = document.getElementById("intro");
    document.write("<p>文本来自 id 为 intro 段落: " + x + "</p>");

    var test = document.getElementById("test-div");
    console.log("dom-----" + test);
</script>

</html>